<?php

namespace app\validate;

use app\base\BaseValidate;

/**
 * 验证器-ActivityValidate
 * Class ActivityValidate
 * @package app\validate
 */
class ActivityValidate extends BaseValidate
{
    protected $rule = [
        'id' => 'require|number',
        'name|活动名称' => 'require',
        'intro|活动简介' => 'require',
        'condition_time|拼团有效时间' => 'require',
        'start_time|活动开始时间' => 'gt:0',
        'end_time|活动结束时间' => 'gt:0',
        'status|状态' => 'require|in:1,2',
    ];


    //验证场景-更新
    public function sceneUpdate()
    {
        return $this->only(['id', 'name', 'intro', 'condition_time', 'status']);
    }
}
